<!-- 话题 -->
<template>
    <view class="no-comment" @click="commentFn()"><text>禁止评论</text><img src="@/assets/image/icon02.png" alt="" v-if="!isComment"><img v-else src="@/assets/image/icon01.png" alt=""/></view>
</template>

<script setup>
import { toRefs } from "vue";
import { reactive, ref, getCurrentInstance, onMounted } from "vue"
const state = reactive({
    isComment:false
})
const emits = defineEmits(['update:isComment'])

let { isComment } = toRefs(state)
const commentFn = () => {
    state.isComment = !state.isComment
    emits('update:isComment',state.isComment)
}

</script>

<style lang="scss" scoped>
.no-comment{
    display: flex;
    width: max-content;
    align-items: center;
    height: 44rpx;
    color:#333;
    font-size: 24rpx;
    img{
        width: 28rpx;
        height: 28rpx;
        margin-left: 5rpx;
    }
}

</style>
